package com.wgj.android.accesslibility.config;

import com.jiaai.xui.utils.XPreferencesUtils;
import com.jiaai.xui.utils.XResourcesUtils;

/**
 * ========================================
 * 作    者： 佳爱网络有限公司(wwww.jiaailove.com)
 * 版    本： 1.0
 * 创建日期：  2017/11/14
 * 描    述：  微信红包插件配制
 * 修订历吏：
 * =========================================
 */
public class WXQiangHongBaoConfig {




    public static final int WX_MODE_0 = 0;//自动抢
    public static final int WX_MODE_1 = 1;//抢单聊红包,群聊红包只通知
    public static final int WX_MODE_2 = 2;//抢群聊红包,单聊红包只通知
    public static final int WX_MODE_3 = 3;//通知手动抢

    /**
     *  是否启动微信抢红包
     */
    public static final String KEY_ENABLE_WECHAT = "QHB_KEY_ENABLE_WECHAT";
    /**
     * 微信打开红包后是否自动回到桌面
     */
    public  static final  String WX_AFTER_GET_GOHOME="QHB_WX_AFTER_GET_GOHOME";

    /**
     * 声音提醒
     */
    public static final String KEY_NOTIFY_SOUND = "QHB_KEY_NOTIFY_SOUND";

    /**
     * 震动
     */
    public static final String KEY_NOTIFY_VIBRATE = "QHB_KEY_NOTIFY_VIBRATE";
    /**
     * 夜间免打扰
     */
    public static final String KEY_NOTIFY_NIGHT_ENABLE = "QHB_KEY_NOTIFY_NIGHT_ENABLE";

    /**
     * 是否启动通知栏监听
     */
    public static final String KEY_NOTIFICATION_SERVICE_ENABLE = "QHB_KEY_NOTIFICATION_SERVICE_ENABLE";

    public static final String KEY_WECHAT_AFTER_OPEN_HONGBAO = "QHB_KEY_WECHAT_AFTER_OPEN_HONGBAO";

    /**
     * 微信打开红包后延时时间
     */
    public static final String KEY_WECHAT_DELAY_TIME = "QHB_EY_WECHAT_DELAY_TIME";
    public static final String KEY_WECHAT_AFTER_GET_HONGBAO = "QHB_KEY_WECHAT_AFTER_GET_HONGBAO";

    /**
     * 微信红包的模式 0全部 1群  2单聊
     */
    public static final String KEY_WECHAT_MODE = "QHB_KEY_WECHAT_MODE";

    public  static  final  String  LAST_ENABLE_TIME="QHB_LAST_ENABLE_TIME";

    public  static  final  String  LAST_STOP_TIME="QHB_LAST_STOP_TIME";

    /**
     * 获取最后一次结束时间
     * @return
     */
    public  static long  getLastStopTime(){
        return (long) XPreferencesUtils.get(LAST_STOP_TIME,0);
    }

    public static  void setLastStopTime(long time){
        XPreferencesUtils.put(LAST_STOP_TIME,time);
    }
    /**
     * 获取最后一次启动时间
     * @return
     */
    public  static long  getLastEnableTime(){
        return (long) XPreferencesUtils.get(LAST_ENABLE_TIME,0);
    }

    public static  void setLastEnableTime(long time){
        XPreferencesUtils.put(LAST_ENABLE_TIME,time);
    }

    /**
     * 是否启动微信抢红包
     * @return
     */
    public  static boolean isEnableWechat() {
        return (boolean) XPreferencesUtils.get(KEY_ENABLE_WECHAT,true);
    }



    public static void setIsEnableWechat(boolean ok) {
        XPreferencesUtils.put(KEY_ENABLE_WECHAT,ok);
    }
    /**
     * 微信打开红包后是否自动回到桌面
     * @return
     */
    public static boolean getWechatAfterOpenHongBao() {
        return (boolean) XPreferencesUtils.get(WX_AFTER_GET_GOHOME,true);
    }
    public static void setWechatAfterOpenHongBao(boolean ok) {
         XPreferencesUtils.put(WX_AFTER_GET_GOHOME,ok);
    }

    /**
     * 微信打开红包后延时时间
     * @return
     */
    public static int getWechatOpenDelayTime() {
        return (int) XPreferencesUtils.get(KEY_WECHAT_DELAY_TIME,1)*1000;
    }
    public static void setWechatOpenDelayTime(int time) {
        XPreferencesUtils.put(KEY_WECHAT_DELAY_TIME,time);
    }

    /**
     *  获取抢微信红包的模式 0全部 1群  2单聊
     * @return
     */
    public static int getWechatMode() {
        return (int) XPreferencesUtils.get(KEY_WECHAT_MODE,0);
    }
    public static  void  setWechatMode(int mode){
        XPreferencesUtils.put(KEY_WECHAT_MODE,mode);
    }

    /**
     * 是否启动通知栏模式
     * @return
     */
    public static boolean isEnableNotificationService() {
        return (boolean) XPreferencesUtils.get(KEY_NOTIFICATION_SERVICE_ENABLE,true);
    }

    /**
     * 设置通通知栏模式
     * @param enable
     */
    public static void setIsEnableNotificationService(boolean enable) {
        XPreferencesUtils.put(KEY_NOTIFICATION_SERVICE_ENABLE, enable);
    }

    /**
     * 是否开启声音
     * @return
     */
    public static boolean isNotifySound() {
        return (boolean) XPreferencesUtils.get(KEY_NOTIFY_SOUND, true);

    }
    public static void setIsNotifySound(boolean ok) {
       XPreferencesUtils.put(KEY_NOTIFY_SOUND, ok);

    }

    /**
     * 是否开启震动
     * @return
     */
    public static boolean isNotifyVibrate() {
        return (boolean) XPreferencesUtils.get(KEY_NOTIFY_VIBRATE, true);
    }
    public static   void setIsNotifyVibrate(boolean ok) {
         XPreferencesUtils.put(KEY_NOTIFY_VIBRATE, ok);
    }

    /**
     * 是否开启夜间免打扰模式
     * @return
     */
    public static boolean isNotifyNight() {
        return (boolean) XPreferencesUtils.get(KEY_NOTIFY_NIGHT_ENABLE, false);
    }
    public static void setIsNotifyNight(boolean ok) {
         XPreferencesUtils.put(KEY_NOTIFY_NIGHT_ENABLE, ok);
    }

}
